package ace.cmp.spring.graphql.data.jdbc.querydsl.core.controller.model.impl;

import ace.cmp.spring.graphql.data.jdbc.querydsl.core.controller.model.PageInput;
import ace.cmp.spring.graphql.data.jdbc.querydsl.core.controller.model.SortInput;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author caspar
 * @date 2023/8/29 16:00
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DefaultPageInput implements PageInput {

  @NotNull
  @Builder.Default
  private Integer page = 0;
  @NotNull
  @Builder.Default
  private Integer size = 10;
  @Valid
  @Builder.Default
  private List<SortInput> sorts = new ArrayList<>();
}
